package day05;

import java.util.Scanner;

/*
    分别建立3个方法
    需求1：键盘录入两个数据，返回两个数中的较大值
    需求2：键盘录入两个数据，比较两个是否相等
    需求3：键盘录入三个数据，返回三个数中的最大值
 */
public class FunctionDemo2 {
    public static void main(String[] args) {

        TipsOut();

        Switch();

    }


    //提示系统
    public static void TipsOut() {
        //提示信息
        System.out.println("请选择进入的系统");
        System.out.println("[1]--比较两个数据的较大值");
        System.out.println("[2]--比较两个数据是否相等");
        System.out.println("[3]--比较三个数据中的最大值");
    }

    //选择系统
    public static void Switch() {
        Scanner sc = new Scanner(System.in);
        //switch
        switch (sc.nextInt()) {
            case 1:
                TwoDataCompare();
                break;
            case 2:
                TwoDataEquality();
                break;
            case 3:
                ThreeDataCompare();
                break;
            default:
                System.out.println("你输入的数据有误！");
        }
    }

    private static void ThreeDataCompare() {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int MaxNumber = (a>b)?((a>c)?a:c):((b>c)?b:c);
        System.out.println(MaxNumber);

    }

    private static void TwoDataEquality() {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a == b){
            System.out.println("相等");
        }else{
            System.out.println("不相等");
        }

    }

    private static void TwoDataCompare() {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int MaxNumber = (a>b)?a:b;
        System.out.println(MaxNumber);

    }

}